package com.cangshukj.system.domain;


import com.cangshukj.common.annotation.Excel;
import com.cangshukj.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 地区对象 sys_region
 * 
 * @author ruoyi
 * @date 2022-03-08
 */
@ApiModel("地区实体类")
public class SysRegion extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("地区ID")
    private String regionid;

    @ApiModelProperty("地区名称")
    @Excel(name = "地区名称")
    private String name;

    @ApiModelProperty("pid(上级)")
    @Excel(name = "上级id")
    private String pid;

    @ApiModelProperty("简称")
    @Excel(name = "简称")
    private String shortName;

    @ApiModelProperty("组合名")
    @Excel(name = "组合名")
    private String mergerName;

    @ApiModelProperty("层级:0省级 1市级 2县级 3乡镇级 4村级")
    @Excel(name = "层级:0省级 1市级 2县级 3乡镇级 4村级")
    private int level;

    @ApiModelProperty("邮政编码")
    @Excel(name = "邮政编码")
    private String zipCode;

    @ApiModelProperty("区号")
    @Excel(name = "区号")
    private String cityCode;

    @ApiModelProperty("拼音")
    @Excel(name = "拼音")
    private String pinyin;

    @ApiModelProperty("经度")
    @Excel(name = "经度")
    private BigDecimal lng;

    @ApiModelProperty("纬度")
    @Excel(name = "纬度")
    private BigDecimal lat;

    @ApiModelProperty("激活状态")
    @Excel(name = "激活状态")
    private Integer activaStatus;

    public Integer getActivaStatus() {
        return activaStatus;
    }

    public void setActivaStatus(Integer activaStatus) {
        this.activaStatus = activaStatus;
    }

    /** 是否有子地区 */
    @ApiModelProperty("是否有子地区")
    private boolean hasChildren;
    /** 子地区 */
    private List<SysRegion> children = new ArrayList<>();

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getRegionid() {
        return regionid;
    }

    public void setRegionid(String regionid) {
        this.regionid = regionid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getMergerName() {
        return mergerName;
    }

    public void setMergerName(String mergerName) {
        this.mergerName = mergerName;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public BigDecimal getLng() {
        return lng;
    }

    public void setLng(BigDecimal lng) {
        this.lng = lng;
    }

    public BigDecimal getLat() {
        return lat;
    }

    public void setLat(BigDecimal lat) {
        this.lat = lat;
    }

    public boolean isHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public List<SysRegion> getChildren() {
        return children;
    }

    public void setChildren(List<SysRegion> children) {
        this.children = children;
    }

    public void addChild(SysRegion child){
        this.children.add(child);
    }

    @Override
    public String toString() {
        return "SysRegion{" +
                "regionid='" + regionid + '\'' +
                ", name='" + name + '\'' +
                ", pid='" + pid + '\'' +
                ", shortName='" + shortName + '\'' +
                ", mergerName='" + mergerName + '\'' +
                ", level=" + level +
                ", zipCode='" + zipCode + '\'' +
                ", cityCode='" + cityCode + '\'' +
                ", pinyin='" + pinyin + '\'' +
                ", lng=" + lng +
                ", lat=" + lat +
                ", activaStatus=" + activaStatus +
                ", hasChildren=" + hasChildren +
                ", children=" + children +
                '}';
    }


}
